﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ShowImageInGridView.aspx.cs" Inherits="DemoGridView_ShowImageInGridView" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
    <link rel="stylesheet" href="../style/jquery.autocomplete.css"" />
  <script src="../Scripts/jquery-2.0.0.js"type="text/javascript"></script>
  <script src="../Scripts/jquery.autocomplete.js"type="text/javascript"></script>
  <script type="text/javascript">
  $(document).ready(function() {
    $( "#<%=txtsearch.ClientID%>" ).autocomplete('search.ashx');
  });
  </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        Enter name
        <asp:TextBox ID="txtsearch" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Search" onclick="Button1_Click" />
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:strcon %>" 
            SelectCommand="SELECT * FROM [Product]" 
            OldValuesParameterFormatString="original_{0}">
        </asp:SqlDataSource>
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            BackColor="White" BorderColor="#CCCCCC" BorderStyle="None" BorderWidth="1px" 
            CellPadding="3" Width="826px" Font-Overline="False" Font-Strikeout="False" 
            Font-Underline="False" PageSize="5">
            <RowStyle ForeColor="#000066" />
            <EmptyDataRowStyle Font-Underline="True" />
            <Columns>
                <asp:BoundField DataField="Pid" HeaderText="Mã SP" />
                <asp:BoundField DataField="PName" HeaderText="Tên SP" />
                <asp:BoundField DataField="Price" DataFormatString="{0:#.###,# đ}" 
                    HeaderText="Đơn giá" />
                <asp:TemplateField HeaderText="Ảnh">
                    <ItemTemplate>
                        <asp:Image ID="Image1" runat="server" Height="86px" 
                            ImageUrl='<%# "~/images/" +Eval("picture") %>' Width="98px" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:CommandField ShowDeleteButton="True" />
                <asp:TemplateField HeaderText="Detail">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink1" runat="server" 
                            NavigateUrl='<%# "~/DemoGridView/ProductDetail.aspx?id=" +Eval("Pid") %>'>Detail</asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <FooterStyle BackColor="White" ForeColor="#000066" />
            <PagerStyle BackColor="White" ForeColor="#000066" HorizontalAlign="Left" />
            <SelectedRowStyle BackColor="#669999" Font-Bold="True" ForeColor="White" />
            <HeaderStyle BackColor="#006699" Font-Bold="True" ForeColor="White" />
        </asp:GridView>
    
        <br />
    
    </div>
    </form>
</body>
</html>
